package com.lb.api;

/**
 * 请求异常
 *
 * @author xiemingzhi
 * @since 1.0
 */
public class ApiException extends RuntimeException {

    private final ApiResultCode code;

    public ApiException(ApiResultCode codeEnum, String message) {
        super(message);
        this.code = codeEnum;
    }

    public ApiException(ApiResultCode codeEnum) {
        super(codeEnum.getReason());
        this.code = codeEnum;
    }

    public ApiResultCode getCode() {
        return code;
    }
}
